import { manifest } from "@/env.js"
import { registerPromptResources, registerTools } from "@/prompts.js"
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"

export const server = new McpServer({ name: manifest.name, version: manifest.version })

server.registerTool(...(await import("@/tools/git/commit.js")).default)
server.registerTool(...(await import("@/tools/git/diff.js")).default)
server.registerTool(...(await import("@/tools/git/recent.js")).default)

// Register all markdown prompt files as resources.
registerPromptResources(server)
registerTools(server)
